import request from '@/untils/request'
import { AxiosResponse, AxiosRequestConfig } from 'axios'
import { LoginType, responseType, IndexType } from '@/types/api'


// 案例
export function LoginApiBlod(query: LoginType): Promise<AxiosResponse<Blob>> {
    return request.post('/login', query, { responseType: 'blob' });
}
export function LoginApi(query: LoginType): Promise<responseType> {
    return request.post('/login', query,);
}
export function getInfoApi(): Promise<responseType> {
    return request.get('/getInfo');
}
// 解决警告：类型“IndexType”与类型“AxiosRequestConfig<any>”不具有相同的属性
export function getIndexApi(params: IndexType): Promise<responseType> {
    return request.get('/weiquan/index/caseTotal', { params } as AxiosRequestConfig);
}
export function getIndexTableApi(params: IndexType): Promise<responseType> {
    return request.get('weiquan/index/townRanking', { params } as AxiosRequestConfig);
}


